class Dog:  # 定义属性
    legs, eyes, ears = 4, 2, 2  # 4条腿 # 2只眼睛 2只耳朵

    def bark(self):
        print("狗狗会汪汪叫...")

    def hobby(self):
        print("狗狗的爱好是拆家！")

    def wagTail(self):
        print("狗狗会摇尾巴！")

    def guardHouse(self):
        print("狗狗会帮主人看家！")


dog1 = Dog()  # 创建实例对象
print("狗狗有{0}条腿，{1}只眼睛和{2}只耳朵".format(dog1.legs, dog1.eyes, dog1.ears))
dog1.bark()
dog1.hobby()
dog1.wagTail()
dog1.guardHouse()
